package com.yunshang.shoppingmall.config;



import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;


import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Component;

@Component
public class ErrorPageConfig implements ErrorPageRegistrar {

    @Override
    public void registerErrorPages(ErrorPageRegistry registry) {
      ErrorPage error401Page = new ErrorPage(HttpStatus.FORBIDDEN, "/403.html");
      ErrorPage error402Page = new ErrorPage(HttpStatus.UNAUTHORIZED, "/403.html");
        registry.addErrorPages(error401Page,error402Page);
    }

}
